<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>{{$store.state.msg}}</h2>
    <button @click='changeMsg'>点击改变msg</button>
   
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: '欢迎学习vuex的基本知识 学习vuex 心态要好'
    }
  },
  methods: {
    changeMsg() {
      this.$store.commit ('changemsg')

    }
  },
}
</script>


<style scoped>

</style>
